#!/usr/bin/env python
# -*- coding: utf-8 -*-

from BeautifulSoup import BeautifulSoup
import urllib
import urllib2


#informacao retirada da pagina
#http://www.crummy.com/software/BeautifulSoup/download/2.x/documentation.html

class procurahtml:
    global soup
    def __init__(self, Urlfornecida):
        global soup

        page = urllib.urlopen(Urlfornecida)
        soup = BeautifulSoup(''.join(page.read()))

    def tagH1(self):
        global soup
        return len(soup('h1'))
    
    def tagH2(self):
        global soup
        return len(soup('h2'))
    
    def tagH3(self):
        global soup
        return len(soup('h3'))
    
    def tagDIV(self):
        global soup
        return len(soup('div'))
    
    def tagP(self):
        global soup
        return len(soup('p'))
    
    def tagUl(self):
        global soup
        return len(soup('ul'))
    
    def tagOl(self):
        global soup
        return len(soup('ol'))

